package com.ybkj.daijia.api.apirest;

import com.ybkj.daijia.server.model.MemberNotice;
import com.ybkj.daijia.server.service.MemberNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller("ApiMemberNoticeProcessController")
@RequestMapping(value = "api/membernotice/")
public class MemberNoticeProcessController {

    @Autowired
    private MemberNoticeService memberNoticeService;


    @RequestMapping(value = "view/{id}", method = RequestMethod.GET)
    public ModelAndView view(@PathVariable("id") Long id) {

        ModelAndView mv = new ModelAndView();
        MemberNotice memberNotice = memberNoticeService.findOne(id);
        if (null != memberNotice) {
            mv.addObject("notice", memberNotice);
            mv.setViewName("membernotice/view");
        }

        return mv;

    }


}
